3. vSRM Tuning (Two-Parameter) Exploration¶

In practice, it is difficult to alter SRC length and the ITM transmission after the construction of a detector. We focus now on co-varying the practically-tunable degrees of freedom i.e. the microscopic tuning of the vSRM in the common and differential modes. When there is detuning i.e. $\phi_{comm}\neq 0^\circ$ (assuming dark fringe condition on vSRM), radiation pressure makes the test masses respond to forces as though they were connected to an optical spring, leading to a drastic change in the shape of the sensitivity curve [Buonanno & Chen 2002]. This is because the SRM reflects quantum noise back into the interferometer, inducing a dynamical correlation between radiation pressure noise and quantum shot noise. This may enable the detector to beat the standard quantum limit (where radiation pressure and shot noise are equal). A priori, it is plausible that optimal detector designs may feature a detuned SRC.

In [1]:
import finesse
import numpy as np
import plotly.graph_objects as go
import plotly.express as px
import nemo_optimisation_modules as nom
import plotly.io as pio
pio.renderers.default='notebook'

3.1 SRM-vSRM Relations¶

We show that an isolated Michelson acts as a variable-reflectivity mirror, with the reflectivity depending only on the differential-mode tuning. This also holds for a Michelson as a signal-recycling mirror. In the vSRM configuration, we make the following assumptions: mirrors are perfectly reflective ($T=0$), macroscopic arm length is fixed at 4.5m, and the dark fringe condition.

3.1.1 Isolated Michelson Reflectivity¶

Refer to pp. 59 of de Vine's Honour's thesis. It can be shown that a Michelson has complex transmittivity and reflectivity $t_\text{Mich}=i\sin(2\omega\Delta L/c)e^{2i\omega L/c},r=\cos(2\omega\Delta L/c)e^{2i\omega L/c}$ where $\omega L/c$ is the phase acquired when a beam travels from the beamsplitter to the arm mirrors. We refer to $\phi_\text{diff}:=\omega\Delta L/c$ due to differential arm length. For the power transmittivity, it follows that $T_\text{SRM}(\phi_\text{diff})=1-\cos^2(2\phi_\text{diff}\cdot\frac{\pi}{180})$. (We assume the dark fringe condition but the result still holds for a translated cosine).

In [2]:
vary_diff = np.linspace(-180, 180, 361)
a_refl_abs = np.zeros((361,))
cosine_abs = np.abs(np.cos(2*np.deg2rad(vary_diff)))

for i, diff in enumerate(vary_diff):
    kat = finesse.Model()
    kat.parse(
        f"""
        ###########################################################################
        ###   Input optics
        ###########################################################################
        l L0 500

        ###########################################################################
        ###   vSRM
        ###########################################################################

        s src L0.p1 SRC_BS.p1 L=354
        bs SRC_BS T=0.5 L=0 alpha=45
        s vSRC1 SRC_BS.p2 vSRM1.p1 L=0
        m vSRM1 T=0 L=0 phi={90+diff}
        s vSRC2  SRC_BS.p3 vSRM2.p1 L=0
        m vSRM2 T=0 L=0 phi={0-diff}

        ad E_in L0.p1.o f=L0.f
        ad E_out SRC_BS.p1.o f=L0.f

        noxaxis()

        """
        )
    out = kat.run()
    E_in = out['E_in']
    E_out = out['E_out']
    a_refl_abs[i] = np.abs(E_out/E_in)
    
fig = go.Figure()
fig.update_layout(title="Michelson Reflectivity",xaxis_title="Differential-Mode Tuning [deg]",yaxis_title="|E_r/E_i|")
fig.add_trace(go.Scatter(x=vary_diff, y=a_refl_abs,mode='lines+markers',name='Finesse'))
fig.add_trace(go.Scatter(x=vary_diff, y=cosine_abs,mode='lines',name='Equation'))


    

3.1.2 Quantifying Error: Varying $\phi_\text{comm}$¶

In the SRM configuration, the signal-recycling cavity is formed between the SRM and the ITMs. For a vSRM, the SRC is formed between the vSRM mirrors and the ITMs i.e. main BS to ITMs + srcL + vSRM BS to vSRM mirrors. So srcL is not actually the SRC length (but it dominates the sum effectively). The vSRM common-mode tuning is related to the SRC tuning in the SRM configuration by $\phi_\text{SRC}=-90^\circ+\phi_\text{comm}$ (assuming a vSRM with the dark fringe condition). We make srcL equal and compare the error between ASD curves between vSRM and SRM configurations according to the SRM-vSRM relations. We skip impedance matching and squeezing for brevity (the results should still be indicative). It is more helpful to consider the relative error (with respect to the vSRM sensitivity) which is small (log scale).

In [3]:
vary_phiComm = np.linspace(-180, 180, 361)
rel_err = np.zeros((361,201))
abs_err = np.zeros((361,201))

vSRM_phiDiff = 6.3565
vSRM_srcL = 354
default_itmT = 0.01397
default_prmT = 0.03
default_lasPow = 500

SRM_srmT = 1-np.cos(2*vSRM_phiDiff*np.pi/180)**2
SRM_srcL = vSRM_srcL + 4.5

for i, phiComm in enumerate(vary_phiComm):
    # vSRM sensitivity
    fsig, ASDarr_vSRM, prmT, lasPow = nom.Finesse_sensitivity_into_Bilby(phiComm,vSRM_phiDiff,vSRM_srcL,default_itmT,prmT=default_prmT,lasPow=default_lasPow,optimise_prmT=False,export_peaks=False,squeezing=False)
    kat = finesse.Model()
    # SRM sensitivity (adjust for proper srcL)
    kat.parse(
    f"""
    # NEMO Base Model (simplified from OzHF_ITMloss_4km.kat and converted to Finesse 3)
    ###########################################################################
    ###   Variables
    ###########################################################################
    var Larm 4000
    var Mtm  74.1 # from NEMO paper (94.4 in OzHF_ITMloss_4km.kat)
    var itmT {default_itmT}
    var lmichx 4.5
    var lmichy 4.5 # Changed for symmetry

    ###########################################################################
    ###   Input optics
    ###########################################################################
    l L0 {default_lasPow}

    s l_in L0.p1 prm.p1
    # Power recycling mirror
    m prm T={default_prmT} L=2e-05 phi=90
    s prc prm.p2 bs.p1 L=53

    # Central beamsplitter
    bs bs R=0.4999625 T=0.4999625 alpha=45

    # CHECK Input laser power
    pd P_in L0.p1.o
    # CHECK Laser power incident on BS
    pd P_BS bs.p1.i
    # CHECK PRC Power
    pd P_PRC bs.p1.o

    ###########################################################################
    ###   X arm
    ###########################################################################
    s lx bs.p3 itmxar.p1 L=lmichx

    m itmxar T=1-265.0e-06 L=265.0e-06 phi=180 # phi from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb (0.0 in OzHF_ITMloss_4km.kat)
    s ar_thick itmxar.p2 itmx.p1 L=0
    m itmx T=itmT L=20u phi=180
    s LX itmx.p2 etmx.p1 L=Larm

    m etmx T=5u L=20u phi=179.99999

    pendulum itmx_sus itmx.mech mass=Mtm fz=1 Qz=1M
    pendulum etmx_sus etmx.mech mass=Mtm fz=1 Qz=1M

    # CHECK X-arm cavity power
    pd P_armX etmx.p1.i

    ###########################################################################
    ###   Y arm
    ###########################################################################
    s ly bs.p2 itmyar.p1 L=lmichy

    m itmyar T=1-265.0e-06 L=265.0e-06 phi=90 # phi from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb (0.0 in OzHF_ITMloss_4km.kat)
    s ar_thicky itmyar.p2 itmy.p1 L=0
    m itmy T=itmT L=20u phi=90
    s LY itmy.p2 etmy.p1 L=Larm

    m etmy T=5u L=20u phi=90.00001

    pendulum itmy_sus itmy.mech mass=Mtm fz=1 Qz=1M
    pendulum etmy_sus etmy.mech mass=Mtm fz=1 Qz=1M

    # CHECK Y-arm cavity power
    pd P_armY etmy.p1.i

    ###########################################################################
    ###   SRM
    ###########################################################################
    s src bs.p4 srm.p1 L={SRM_srcL}
    m srm R={0.99985-SRM_srmT} T={SRM_srmT} phi={-90+phiComm}

    # CHECK SRC power
    pd P_SRC srm.p1.i

    ###########################################################################
    ###   Output & squeezing (from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb)
    ###########################################################################
    dbs OFI 
    link(srm.p2, OFI.p1)
    readout_dc AS OFI.p3.o

    # A squeezed source could be injected into the dark port
    # sq sqz db=7 angle=90
    # link(sqz, OFI.p2)

    # ------------------------------------------------------------------------------
    # Degrees of Freedom
    # ------------------------------------------------------------------------------
    dof STRAIN LX.dofs.h +1  LY.dofs.h -1

    # signal generator
    sgen sig STRAIN

    qnoised NSR_with_RP AS.p1.i nsr=True
    # qshot NSR_without_RP AS.p1.i nsr=True
    # pd1 signal AS.p1.i f=fsig

    fsig(1)
    xaxis(fsig, log, 100, 10k, 200)
    """
    )
    out = kat.run()
    ASDarr_SRM = np.abs(out['NSR_with_RP'])
    abs_err[i,:] = np.abs(ASDarr_SRM-ASDarr_vSRM)
    rel_err[i,:] = np.abs((ASDarr_SRM-ASDarr_vSRM)/ASDarr_vSRM)

    
fig_abs_err = go.Figure(data=go.Contour(z=np.log10(abs_err),x=fsig,y=vary_phiComm))
fig_abs_err.update_layout(title="SRM-vSRM Relations Absolute ASD Error (qnoised)",xaxis_title="Frequency [Hz]",yaxis_title="phiComm [deg]")
fig_abs_err.update_xaxes(type="log")
fig_abs_err.show()

fig_rel_err = go.Figure(data=go.Contour(z=np.log10(rel_err),x=fsig,y=vary_phiComm))
fig_rel_err.update_layout(title="SRM-vSRM Relations Relative ASD Error (qnoised)",xaxis_title="Frequency [Hz]",yaxis_title="phiComm [deg]")
fig_rel_err.update_xaxes(type="log")
fig_rel_err.show()

3.1.3 Quantifying Error: Varying $\phi_\text{diff}$¶

TODO: Why for $45^\circ<\phi_\text{diff}<135^\circ$ does the error become very significant? (vSRM sensitivity becomes much less than the SRM sensitivity - this shouldn't affect the optimisation because these configurations will very likely be ruled out)

In [4]:
vary_phiDiff = np.linspace(-180, 180, 361)
rel_err = np.zeros((361,201))
abs_err = np.zeros((361,201))

vSRM_phiComm = 0
vSRM_srcL = 354
default_itmT = 0.01397
default_prmT = 0.03
default_lasPow = 500

SRM_srcL = vSRM_srcL + 4.5
SRM_srmPhi = -90+vSRM_phiComm

for i, phiDiff in enumerate(vary_phiDiff):
    # vSRM sensitivity
    fsig, ASDarr_vSRM, prmT, lasPow = nom.Finesse_sensitivity_into_Bilby(vSRM_phiComm,phiDiff,vSRM_srcL,default_itmT,prmT=default_prmT,lasPow=default_lasPow,optimise_prmT=False,export_peaks=False,squeezing=False)
    SRM_srmT = 0.99985*(1-np.cos(2*phiDiff*np.pi/180)**2)
    kat = finesse.Model()
    # SRM sensitivity (adjust for proper srcL)
    kat.parse(
    f"""
    # NEMO Base Model (simplified from OzHF_ITMloss_4km.kat and converted to Finesse 3)
    ###########################################################################
    ###   Variables
    ###########################################################################
    var Larm 4000
    var Mtm  74.1 # from NEMO paper (94.4 in OzHF_ITMloss_4km.kat)
    var itmT {default_itmT}
    var lmichx 4.5
    var lmichy 4.5 # Changed for symmetry

    ###########################################################################
    ###   Input optics
    ###########################################################################
    l L0 {default_lasPow}

    s l_in L0.p1 prm.p1
    # Power recycling mirror
    m prm T={default_prmT} L=2e-05 phi=90
    s prc prm.p2 bs.p1 L=53

    # Central beamsplitter
    bs bs R=0.4999625 T=0.4999625 alpha=45

    # CHECK Input laser power
    pd P_in L0.p1.o
    # CHECK Laser power incident on BS
    pd P_BS bs.p1.i
    # CHECK PRC Power
    pd P_PRC bs.p1.o

    ###########################################################################
    ###   X arm
    ###########################################################################
    s lx bs.p3 itmxar.p1 L=lmichx

    m itmxar T=1-265.0e-06 L=265.0e-06 phi=180 # phi from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb (0.0 in OzHF_ITMloss_4km.kat)
    s ar_thick itmxar.p2 itmx.p1 L=0
    m itmx T=itmT L=20u phi=180
    s LX itmx.p2 etmx.p1 L=Larm

    m etmx T=5u L=20u phi=179.99999

    pendulum itmx_sus itmx.mech mass=Mtm fz=1 Qz=1M
    pendulum etmx_sus etmx.mech mass=Mtm fz=1 Qz=1M

    # CHECK X-arm cavity power
    pd P_armX etmx.p1.i

    ###########################################################################
    ###   Y arm
    ###########################################################################
    s ly bs.p2 itmyar.p1 L=lmichy

    m itmyar T=1-265.0e-06 L=265.0e-06 phi=90 # phi from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb (0.0 in OzHF_ITMloss_4km.kat)
    s ar_thicky itmyar.p2 itmy.p1 L=0
    m itmy T=itmT L=20u phi=90
    s LY itmy.p2 etmy.p1 L=Larm

    m etmy T=5u L=20u phi=90.00001

    pendulum itmy_sus itmy.mech mass=Mtm fz=1 Qz=1M
    pendulum etmy_sus etmy.mech mass=Mtm fz=1 Qz=1M

    # CHECK Y-arm cavity power
    pd P_armY etmy.p1.i

    ###########################################################################
    ###   SRM
    ###########################################################################
    s src bs.p4 srm.p1 L={SRM_srcL}
    m srm R={0.99985-SRM_srmT} T={SRM_srmT} phi={SRM_srmPhi}

    # CHECK SRC power
    pd P_SRC srm.p1.i

    ###########################################################################
    ###   Output & squeezing (from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb)
    ###########################################################################
    dbs OFI 
    link(srm.p2, OFI.p1)
    readout_dc AS OFI.p3.o

    # A squeezed source could be injected into the dark port
    # sq sqz db=7 angle=90
    # link(sqz, OFI.p2)

    # ------------------------------------------------------------------------------
    # Degrees of Freedom
    # ------------------------------------------------------------------------------
    dof STRAIN LX.dofs.h +1  LY.dofs.h -1

    # signal generator
    sgen sig STRAIN

    qnoised NSR_with_RP AS.p1.i nsr=True
    # qshot NSR_without_RP AS.p1.i nsr=True
    # pd1 signal AS.p1.i f=fsig

    fsig(1)
    xaxis(fsig, log, 100, 10k, 200)
    """
    )
    out = kat.run()
    ASDarr_SRM = np.abs(out['NSR_with_RP'])
    abs_err[i,:] = np.abs(ASDarr_SRM-ASDarr_vSRM)
    rel_err[i,:] = np.abs((ASDarr_SRM-ASDarr_vSRM)/ASDarr_vSRM)

    
fig_abs_err = go.Figure(data=go.Contour(z=np.log10(abs_err),x=fsig,y=vary_phiComm))
fig_abs_err.update_layout(title="SRM-vSRM Relations Absolute ASD Error (qnoised)",xaxis_title="Frequency [Hz]",yaxis_title="phiDiff [deg]")
fig_abs_err.update_xaxes(type="log")
fig_abs_err.show()

fig_rel_err = go.Figure(data=go.Contour(z=np.log10(rel_err),x=fsig,y=vary_phiComm))
fig_rel_err.update_layout(title="SRM-vSRM Relations Relative ASD Error (qnoised)",xaxis_title="Frequency [Hz]",yaxis_title="phiDiff [deg]")
fig_rel_err.update_xaxes(type="log")
fig_rel_err.show()

3.1.4 Comparing SRM and vSRM configurations (Interactive)¶

The similarities between the SRM and vSRM configuration sensitivity curves can be seen directly on this interactive dashboard (SRM configuration tuning and reflectivity calculated from vSRM common- and differential-mode tuning respectively).

In [5]:
import finesse
import ipywidgets as widgets
from ipywidgets import HBox, VBox
import matplotlib.pyplot as plt
from IPython.display import display
import numpy as np
import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
from scipy.signal import find_peaks, peak_widths
from scipy import interpolate


default_srcL = 354
default_phiComm = 0
default_phiDiff = 6.3565
default_itmT = 0.01397
default_prmT = 0.03
default_lasPow = 500

SRM_srcL = default_srcL + 4.5

def plot(phiComm,phiDiff): # This executes when 'Interact' is clicked     
    # Initialise variables (
    # if no peak is found a log error will be thrown for the maximum and half-maximum lines but the sensitivity curves are OK)
    fsig = np.geomspace(100,10e3,201)
    phiComm = float(phiComm)
    phiDiff = float(phiDiff)
    
    fsig, ASDarr_vSRM, prmT, lasPow = nom.Finesse_sensitivity_into_Bilby(default_phiComm,phiDiff,vSRM_srcL,default_itmT,prmT=default_prmT,lasPow=default_lasPow,optimise_prmT=False,export_peaks=False,squeezing=False)
    SRM_srmT = 0.99985*(1-np.cos(2*phiDiff*np.pi/180)**2)
    kat = finesse.Model()
    kat.parse(
    f"""
    # NEMO Base Model (simplified from OzHF_ITMloss_4km.kat and converted to Finesse 3)
    ###########################################################################
    ###   Variables
    ###########################################################################
    var Larm 4000
    var Mtm  74.1 # from NEMO paper (94.4 in OzHF_ITMloss_4km.kat)
    var itmT {default_itmT}
    var lmichx 4.5
    var lmichy 4.5 # Changed for symmetry

    ###########################################################################
    ###   Input optics
    ###########################################################################
    l L0 {default_lasPow}

    s l_in L0.p1 prm.p1
    # Power recycling mirror
    m prm T={default_prmT} L=2e-05 phi=90
    s prc prm.p2 bs.p1 L=53

    # Central beamsplitter
    bs bs R=0.4999625 T=0.4999625 alpha=45

    # CHECK Input laser power
    pd P_in L0.p1.o
    # CHECK Laser power incident on BS
    pd P_BS bs.p1.i
    # CHECK PRC Power
    pd P_PRC bs.p1.o

    ###########################################################################
    ###   X arm
    ###########################################################################
    s lx bs.p3 itmxar.p1 L=lmichx

    m itmxar T=1-265.0e-06 L=265.0e-06 phi=180 # phi from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb (0.0 in OzHF_ITMloss_4km.kat)
    s ar_thick itmxar.p2 itmx.p1 L=0
    m itmx T=itmT L=20u phi=180
    s LX itmx.p2 etmx.p1 L=Larm

    m etmx T=5u L=20u phi=179.99999

    pendulum itmx_sus itmx.mech mass=Mtm fz=1 Qz=1M
    pendulum etmx_sus etmx.mech mass=Mtm fz=1 Qz=1M

    # CHECK X-arm cavity power
    pd P_armX etmx.p1.i

    ###########################################################################
    ###   Y arm
    ###########################################################################
    s ly bs.p2 itmyar.p1 L=lmichy

    m itmyar T=1-265.0e-06 L=265.0e-06 phi=90 # phi from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb (0.0 in OzHF_ITMloss_4km.kat)
    s ar_thicky itmyar.p2 itmy.p1 L=0
    m itmy T=itmT L=20u phi=90
    s LY itmy.p2 etmy.p1 L=Larm

    m etmy T=5u L=20u phi=90.00001

    pendulum itmy_sus itmy.mech mass=Mtm fz=1 Qz=1M
    pendulum etmy_sus etmy.mech mass=Mtm fz=1 Qz=1M

    # CHECK Y-arm cavity power
    pd P_armY etmy.p1.i

    ###########################################################################
    ###   SRM
    ###########################################################################
    s src bs.p4 srm.p1 L={SRM_srcL}
    m srm R={0.99985-SRM_srmT} T={SRM_srmT} phi={-90+phiComm}

    # CHECK SRC power
    pd P_SRC srm.p1.i

    ###########################################################################
    ###   Output & squeezing (from SRC_tunability_DCreadout_changedBW_fin3exp.ipynb)
    ###########################################################################
    dbs OFI 
    link(srm.p2, OFI.p1)
    readout_dc AS OFI.p3.o

    # A squeezed source could be injected into the dark port
    # sq sqz db=7 angle=90
    # link(sqz, OFI.p2)

    # ------------------------------------------------------------------------------
    # Degrees of Freedom
    # ------------------------------------------------------------------------------
    dof STRAIN LX.dofs.h +1  LY.dofs.h -1

    # signal generator
    sgen sig STRAIN

    qnoised NSR_with_RP AS.p1.i nsr=True
    # qshot NSR_without_RP AS.p1.i nsr=True
    # pd1 signal AS.p1.i f=fsig

    fsig(1)
    xaxis(fsig, log, 100, 10k, 200)
    """
    )
    out = kat.run()
    ASDarr_SRM = np.abs(out['NSR_with_RP'])
    
    fig_qnoise = go.Figure()
    fig_qnoise.update_xaxes(type="log")
    fig_qnoise.update_yaxes(type="log")
    fig_qnoise.update_layout(title="SRM vs. vSRM Detector Sensitivity",xaxis_title="Frequency [Hz]",yaxis_title="ASD (qnoised) [1/rt Hz]")
    fig_qnoise.add_trace(go.Scatter(x=fsig, y=ASDarr_vSRM,mode='lines+markers',name='vSRM'))
    fig_qnoise.add_trace(go.Scatter(x=fsig, y=ASDarr_SRM,mode='lines+markers',name='SRM'))
    fig_qnoise.show()
    

# Default values here
widgets.interact_manual(plot, phiComm=widgets.Text(value=f"{default_phiComm}"),
                 phiDiff=widgets.Text(value=f"{default_phiDiff}"));
#
interactive(children=(Text(value='0', description='phiComm'), Text(value='6.3565', description='phiDiff'), But…

3.2 vSRM Orthogonality¶

Refer to de Vine, G, Shaddock, DA & McClelland, DE 2002, ‘Variable reflectivity signal mirrors and signal response measurements', Classical and Quantum Gravity, vol. 19, pp. 1561-1568. de Vine's Honours thesis also contains MATLAB code to demonstrate the key result that a SRM in signal-recycled Michelson interferometer configuration i.e. no arm cavities, can be used to vary the peak frequency and bandwidth "orthogonally". That is, the SRC tuning varies the paek frequency alone, and the SRM reflectivity varies the peak bandwidth alone. In this case, the SRC is formed between two mirrors (one mirror for the Michelson, and one for the SRM). But, if we refer to Section 2.3.1 and 2.3.2, we see that evidently this orthogonality disappears when arm cavities are added. This is because adding ITMs means a three-mirror coupled-cavity is formed, where the SRC is formed between the SRM and ITM, and the ITM or coupling mirror is also part of the arm cavity. I did verify de Vine's results and three-mirror coupled-cavities using Finesse, but those notebooks are very messy and the code in de Vine's work is cleaner.

3.3 Peak Properties vs. Tuning¶

We co-vary common- and differential-mode tuning and find properties of the first peak (if one exists). We plot against the two-parameters. This process takes a long time so the generating code is commented out (use load and find the associated numpy array in ./SaveArrays/).

In [6]:
# import finesse
# import numpy as np
# import plotly.graph_objects as go
# import plotly.express as px
# import pandas as pd
# from scipy.signal import find_peaks, peak_widths
# from scipy import interpolate

# fsig = np.geomspace(100,10e3,201)
vary_phiComm = np.linspace(0.1,10,100)
vary_phiDiff = np.linspace(0.1,10,100)

# peak_sens = np.zeros((100,100))
# peak_f = np.zeros((100,100))
# peak_bw = np.zeros((100,100))

# changed_itmT = True
# store_prmT = 0
# store_lasPow = 0

# # VARY PARAMETER
# for i, phiDiff in enumerate(vary_phiDiff):
#     print(i)
#     for j, phiComm in enumerate(vary_phiComm):
#         if changed_itmT:
#             fsig, ASDarr, prmT, lasPow, peak_dict = nom.Finesse_sensitivity_into_Bilby(phiComm,phiDiff,default_srcL,default_itmT,prmT=0,lasPow=0,optimise_prmT=True,export_peaks=True)
#             store_prmT = prmT
#             store_lasPow = lasPow
#             changed_itmT = False
#             peak_sens[i,j] = peak_dict['peak_sens']
#             peak_f[i,j] = peak_dict['peak_f']
#             peak_bw[i,j] = peak_dict['peak_bw']
#         else: 
#             fsig, ASDarr, prmT, lasPow, peak_dict = nom.Finesse_sensitivity_into_Bilby(phiComm,phiDiff,default_srcL,default_itmT,store_prmT,store_lasPow,optimise_prmT=False,export_peaks=True)
#             peak_sens[i,j] = peak_dict['peak_sens']
#             peak_f[i,j] = peak_dict['peak_f']
#             peak_bw[i,j] = peak_dict['peak_bw']
            
# np.save("SaveArrays/Sec3.3_store_peak_f.npy",peak_f)
# np.save("SaveArrays/Sec3.3_store_peak_bw.npy",peak_bw)
# np.save("SaveArrays/Sec3.3_store_peak_sens.npy",peak_sens)

peak_f = np.load("SaveArrays/Sec3.3_store_peak_f.npy")
peak_bw = np.load("SaveArrays/Sec3.3_store_peak_bw.npy")
peak_sens = np.load("SaveArrays/Sec3.3_store_peak_sens.npy")

fig_peak_f = go.Figure(data=[go.Surface(x=vary_phiComm,y=vary_phiDiff,z=peak_f,opacity=0.5)])
fig_peak_f.update_layout(scene=dict(xaxis=dict(title="phiComm [deg]"),yaxis=dict(title="phiDiff [deg]"),zaxis=dict(title="Peak Frequency [Hz]")))
fig_peak_f.update_layout(title='Peak Frequency vs. vSRM Tuning')
fig_peak_f.show()

fig_peak_bw = go.Figure(data=[go.Surface(x=vary_phiComm,y=vary_phiDiff,z=peak_bw,opacity=0.5)])
fig_peak_bw.update_layout(scene=dict(xaxis=dict(title="phiComm [deg]"),yaxis=dict(title="phiDiff [deg]"),zaxis=dict(title="Peak Bandwidth [Hz]")))
fig_peak_bw.update_layout(title='Peak Bandwidth vs. vSRM Tuning')
fig_peak_bw.show()

fig_peak_sens = go.Figure(data=[go.Surface(x=vary_phiComm,y=vary_phiDiff,z=np.log10(peak_sens),opacity=0.5)])
fig_peak_sens.update_layout(scene=dict(xaxis=dict(title="phiComm [deg]"),yaxis=dict(title="phiDiff [deg]"),zaxis=dict(title="Log Peak Sensitivity [1/rt Hz]")))
fig_peak_sens.update_layout(title='Peak Sensitivity vs. vSRM Tuning')
fig_peak_sens.show()
In [ ]: